How can I simplify this JavaScript and not duplicate the code for different variables

visit shbcf.ru